<table class="list">
		<thead>
		<tr>
	        <th>产品ID</th>
	        <th>图片</th> 
	        <th>标题</th>
	        <th>分类</th>
            <th>供应商</th>
	        <th>发布时间</th>
	        <th>操作</th>
      	</tr>
		</thead>
    <tbody>
		<foreach name='list' item='v'>
        <tr>
           <td>{$v.id}</td>
            <td>
              <img src="<if condition='$v.litpic eq null'>__PUBLIC__/image/product.jpg<else/>__URL__{$v.litpic}</if>" width="220" />
           </td> 
           <td width="23%">{$v.title}<if condition="$v.recommend eq 1"><span style="color:#FF0000;">[今日推荐]</span></if></td>
           <td>
           		<foreach name="v.category" item="cate" >
                {$cate}
              	</foreach>
            </td>
           <td>{$v.supplier}</td>
           <td>{$v.dateline}</td>
           <td width="18%">
               <if condition="$v.recommend eq 1">
                <a href="javascript:;" onclick="toConfirm('{:U(MODULE_NAME.'/Product/recommendout',array('id' => $v['id']), '')}', '确实要取消推荐吗？')">取消推荐</a>&nbsp;
               <else />
               <a href="javascript:;" onclick="toConfirm('{:U(MODULE_NAME.'/Product/recommendin',array('id' => $v['id']), '')}', '确实要推荐吗？')" class="red">今日推荐</a>&nbsp;
               </if>
               <a href="__URL__/Product/details/id/{$v['id']}" target="_blank">查看</a>&nbsp;
               <a href="{:U(MODULE_NAME.'/Product/edit',array('id' => $v['id']), '')}">编辑</a>&nbsp;
               <a href="javascript:" onclick="Down('{$v['id']}','{$v['title']}')">下架</a>&nbsp;
               <a href="javascript:;" onclick="toConfirm('{:U(MODULE_NAME.'/Product/del',array('id' => $v['id']), '')}', '确实要删除吗？')">删除</a>
           </td>
       </tr>
      </foreach>
 </tbody>
</table>
<div class="page" style="clear: both;">{$page}</div>
<script type="text/javascript">
function Down(id,title)
{
	var pageii = $.layer({
	    type: 1,
	    title: '产品下架',
	    area: ['auto', 'auto'],
	    shift: 'top', //从左动画弹出
	    page: {
	        html: '<div class="layer-content"><p>你现在下架的是：'+title+'</p><p>是否下架该产品？</p><p><a href="/Home/Product/marketout/id/'+id+'" class="button-blue">确定</a> <a href="javascript:" class="button-red layer-close">取消</a></p></div>'
	    }
	});
	$('.layer-close').on('click', function(){
	    layer.close(pageii);
	});
}
</script>